UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'tLyUjwG7SA5lG2hDFG6LERTnPIGxOnb3WUhBbIHl1DU='
WHERE
key_id = '327db1f7c4ceac3e777df7a80712329185aba9c306811c76a1c74a34d661dfaf'
AND (
token = 'tLyUjwG7SA5lG2hDFG6LERTnPIGxOnb3WUhBbIHl1DU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)