UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JsXtaNNyqlJHBlELHnRosueSOpqGR6W8ErR+roiDHSI='
WHERE
key_id = 'b3d759c0cc064b01bf3b6a844e772169c665800f3f39659c3093cc7ee2510dbe'
AND (
token = 'JsXtaNNyqlJHBlELHnRosueSOpqGR6W8ErR+roiDHSI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)