UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YojBphskvK+kQWC4YnPUSOre+VYO86B31znAJpKOfQU='
WHERE
key_id = '49168a05334777b16b94107bd6250c4a72340729c7263da519072b503de318b4'
AND (
token = 'YojBphskvK+kQWC4YnPUSOre+VYO86B31znAJpKOfQU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)