UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xaQAJdcDBzwIFMWewKJbbj+ozzt9/yY5/p9iSwlnbXo='
WHERE
key_id = '262efc270cae15028da93258d5ef4df1ae2c9d64502989739921ab143be0677c'
AND (
token = 'xaQAJdcDBzwIFMWewKJbbj+ozzt9/yY5/p9iSwlnbXo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)