UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '27Rf5GCFUMzuWSDaE+if+Q0jfWWFs5JtOwNBB163RIs='
WHERE
key_id = 'a574bd96e2f5935165c81fcad35eeffb33f1961c043a2a3a2b9d3a02aee39f81'
AND (
token = '27Rf5GCFUMzuWSDaE+if+Q0jfWWFs5JtOwNBB163RIs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)