UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4vQIfcNcTen9O4j4VHPJ/0pByr2Uv9PKA2sOuB1sRew=' 
WHERE 
  key_id = 'c1a2c26092b90cb6a117325cd8067b999499e07c9243ad66c6ca7c38452631ee' 
  AND (
    token = '4vQIfcNcTen9O4j4VHPJ/0pByr2Uv9PKA2sOuB1sRew=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033