UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FA9tzrkCR4lE0Z9+bu3TzyyFF7seZ4Xa8IvBf73pYlA=' 
WHERE 
  key_id = '9f8351e1f190d341910377fc5c14559bddd3860479e4815e15e4a420086a0ebf' 
  AND (
    token = 'FA9tzrkCR4lE0Z9+bu3TzyyFF7seZ4Xa8IvBf73pYlA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034