UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'o5b1IqwfJuWA+JyitC9HLshRH9JVfL6jQ/gJzJcYV0g='
WHERE
key_id = '2de5ea8d6069219474693f5e1ea65113f1f199974039843b836de167dae77601'
AND (
token = 'o5b1IqwfJuWA+JyitC9HLshRH9JVfL6jQ/gJzJcYV0g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)