UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'r30e0yCxVpGBqsJ+CI4wQYJ9H1g6lja7/V3tcXsUfsA=' 
WHERE 
  key_id = '7c656c0a6fef18596e5aa7c5b35dc2ce9503f47ce8a9be5bb12acb6754c20f34' 
  AND (
    token = 'r30e0yCxVpGBqsJ+CI4wQYJ9H1g6lja7/V3tcXsUfsA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037