UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oYNoNlhy2XfbuIb3jHaSmL5BEfZYWRhP8i+PjVn2wbA='
WHERE
key_id = '19d5693ced21823550f7b9b03d7c989734591f0a6f03ce6d313960c72da5a7e1'
AND (
token = 'oYNoNlhy2XfbuIb3jHaSmL5BEfZYWRhP8i+PjVn2wbA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)