UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jmkZHQZ0JBXUXify2eikSxnX4Y4k5JpwtrwLV4G43wQ=' 
WHERE 
  key_id = '2774f2ec9b187d05a85fd43576317709127150c82e0e5fcb29cfdfa66c298aa8' 
  AND (
    token = 'jmkZHQZ0JBXUXify2eikSxnX4Y4k5JpwtrwLV4G43wQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028