UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oe4DYQvsiIgF+QvUwkor9be++Jen2D35sgP/f12msDM='
WHERE
key_id = '503612ccdb3f1c4f2b8fb7c9f620ae6c8da415389e08014e04a8a0c4522f437e'
AND (
token = 'oe4DYQvsiIgF+QvUwkor9be++Jen2D35sgP/f12msDM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)