UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lsCflQlr24Qh5+ZClme+AYjlRhHD2qSaX5TjGvVlsys='
WHERE
key_id = '53b9e95144de45a74c170e1b735e6ca1029b3593f37aab22d672fe1d2e331267'
AND (
token = 'lsCflQlr24Qh5+ZClme+AYjlRhHD2qSaX5TjGvVlsys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)