UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WfpaLuS5qX9aAwvDVUk5Jnq3F3oPWuYsffphWw0CPJY=' 
WHERE 
  key_id = '6527fb3b26fd30bbaba1dc2e3d50bc5d8253ddd3d3440abf40107bcac8db164f' 
  AND (
    token = 'WfpaLuS5qX9aAwvDVUk5Jnq3F3oPWuYsffphWw0CPJY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027