UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1weee2CEXVIuK1alQ9tHDSnBFFoYgWwXOKoO/CbNTlo='
WHERE
key_id = '1f9abca24db388f6ad4f55028fc383a541ba380b521776288c3c149095edaebc'
AND (
token = '1weee2CEXVIuK1alQ9tHDSnBFFoYgWwXOKoO/CbNTlo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)