UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ju3l9HDYnzrQ23nGCX0ZXr3LaIYL6NYOKWpNPhkI6V0='
WHERE
key_id = 'b358343db6cadc8ce3e0e8a977b4faf878f81b35b2a83fccdd54a7f61a3d9916'
AND (
token = 'ju3l9HDYnzrQ23nGCX0ZXr3LaIYL6NYOKWpNPhkI6V0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)