UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'smYW0skkyKdY9dyQxc/eulRwRsJrnSBSDfon33YJPok='
WHERE
key_id = '4bd3d94e8768d3d28d08a5b5484f67ffe0bf60b82e08d5838bf2e3bae00bb7a7'
AND (
token = 'smYW0skkyKdY9dyQxc/eulRwRsJrnSBSDfon33YJPok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)