UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's5leMdTg69DKBai339fXFSD3YWcHNF+BK1Q3eSi18iw='
WHERE
key_id = 'bf20620aa8a3cf1ce4f70cdeef412d92910d21fc971f2bd6780918d9dfb4eef5'
AND (
token = 's5leMdTg69DKBai339fXFSD3YWcHNF+BK1Q3eSi18iw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)