UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i7clz1gFSwzh2M6cBfwfb4osmBTyeet05NsVXLbPm9Q='
WHERE
key_id = 'f9dfc8f409c8a2a221cf14f5ea65eaa1e42a722b80435a2c5de841a1f5b86c9a'
AND (
token = 'i7clz1gFSwzh2M6cBfwfb4osmBTyeet05NsVXLbPm9Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)