UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IYvY2uTogMXgdvDc/bAlq80BUshdhAho/1qqK00faSc='
WHERE
key_id = '48e240e761d419cc8c01729488e0814bc15723787f5589abc6ad7b0e82c6f379'
AND (
token = 'IYvY2uTogMXgdvDc/bAlq80BUshdhAho/1qqK00faSc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)