UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AT6kH8XhI+FCAIEk6j6HTGAkEzTmSip+KXtU5Ek7tzE=' 
WHERE 
  key_id = 'fa1363ea8683d08353b31bb4bf634f7409a82fb6f11f6244986108acf14bcda6' 
  AND (
    token = 'AT6kH8XhI+FCAIEk6j6HTGAkEzTmSip+KXtU5Ek7tzE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041