UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'A8o+aOOHH/ylNsJMGXzTb9F7KNBm87QhwfvDAosAOlE=' 
WHERE 
  key_id = '622aa01fde1b80c3a9f46d1a375d79c4959525186d4f0c852d3b3abb32c238c3' 
  AND (
    token = 'A8o+aOOHH/ylNsJMGXzTb9F7KNBm87QhwfvDAosAOlE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021