UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qGcNXEsecamPBRSErglhMv2fV6YwqPvNYRFzxfmYh08=' 
WHERE 
  key_id = '0069c85accafff52d1d6b1817c8ed73aa40c8bcfd8f0c319470e4f704279013c' 
  AND (
    token = 'qGcNXEsecamPBRSErglhMv2fV6YwqPvNYRFzxfmYh08=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00074