UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LtgQ8JlBJC+it6cQmTxr0/dRSAetO/raLYRUITDS2fg=' 
WHERE 
  key_id = '592cab378f780a8a93a5435dc7c578afde7789e8c59c0f5eecffaa4c439169a3' 
  AND (
    token = 'LtgQ8JlBJC+it6cQmTxr0/dRSAetO/raLYRUITDS2fg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045