UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ztgiG+s6vkWro82x8wbYDwOVbBMewACG9AuMXD3czOo='
WHERE
key_id = 'b2019c035786f9a26e9810373fd80fa274b4eee777ef225d0fc30346c6f18a44'
AND (
token = 'ztgiG+s6vkWro82x8wbYDwOVbBMewACG9AuMXD3czOo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)