UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'eeN7WG9RUAHIlcllTf80Mzbyet6HpEZ+AVU8zXWoSLE=' 
WHERE 
  key_id = '4df9e83e82ba0a7674efb1df09ca751b7bd56815ccc4e2054f0a8f39853e43cf' 
  AND (
    token = 'eeN7WG9RUAHIlcllTf80Mzbyet6HpEZ+AVU8zXWoSLE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042