UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+0FdTqTQ6SL7w8iyTo6loXPDCCtG259UoGU3JzY2TLA='
WHERE
key_id = 'a0164e5a0d6b5b44e4f258c12585573fe0f70252bcffa061749c5212ca6c6473'
AND (
token = '+0FdTqTQ6SL7w8iyTo6loXPDCCtG259UoGU3JzY2TLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)