UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LzGRQtgqvXlfmi+Qm9dBCFTreD8HHmanrPoCxmdX0ak='
WHERE
key_id = '665e02ef6e5f4b45f3cccfe6bdbee7131c466d01f8b6b44be3c05c7a5d4e8067'
AND (
token = 'LzGRQtgqvXlfmi+Qm9dBCFTreD8HHmanrPoCxmdX0ak='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)