UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iTpDIE8rzjS0fx6HKT+yj4Z0rWu/qq0KnUtpzAkjAZM='
WHERE
key_id = '51bc66e8f0d7c36a3cb60e56922374283f39370c351934dbb833dd19115fae5a'
AND (
token = 'iTpDIE8rzjS0fx6HKT+yj4Z0rWu/qq0KnUtpzAkjAZM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)