UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pL+jrzUphUmtIwVy9lfInufaZ73qMYmiFnR92rYSfyE=' 
WHERE 
  key_id = '8ba938ff4bf566d06a683b1005906543a91921cd358b6b112d195626e561df5d' 
  AND (
    token = 'pL+jrzUphUmtIwVy9lfInufaZ73qMYmiFnR92rYSfyE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035