UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'lTxY5FzhOisiLILfQ17LQ+u0fvKEnKeLO7qY1R7+l4M=' 
WHERE 
  key_id = '100f2f928702d8a8c05b6c08250b141643134e1bcf2122cf8bef7cf74662cbdb' 
  AND (
    token = 'lTxY5FzhOisiLILfQ17LQ+u0fvKEnKeLO7qY1R7+l4M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021