UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hy6PgDA3cAlrTnuRADPqrnLVRKn/Audre8TyA02wMyk=' 
WHERE 
  key_id = 'e776a5f5a8d1e4b3b5e0edd8f6cb8bba8a85961cdc60359b964595366fa357d5' 
  AND (
    token = 'hy6PgDA3cAlrTnuRADPqrnLVRKn/Audre8TyA02wMyk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015