UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eIj/Q0RWQpas/b1eDYpmrjTXZcu1JUaP3OrIM8tkt5U=' 
WHERE 
  key_id = 'c0f9a40a2a84a74f31e70a69f8f585c550e3b96e9662aefa976d37b28b42a8e4' 
  AND (
    token = 'eIj/Q0RWQpas/b1eDYpmrjTXZcu1JUaP3OrIM8tkt5U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052