UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ixYeLOQVEt7+e2PxdrGhOZ70gjngsrGDTc+iuj5xl8M='
WHERE
key_id = 'b8dbb3d3f7f13b41dcfbfe50dd8f419a39756ccfe82d949b4e80124825f71b29'
AND (
token = 'ixYeLOQVEt7+e2PxdrGhOZ70gjngsrGDTc+iuj5xl8M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)