UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's3SmSnuHWiUKaRaPKTKqnAJZYbbVMn2+2HvS1xDJ2/M='
WHERE
key_id = 'b6ea84456b2b631768a204a873acf03cafb4b95d196479667b1f07171bc68214'
AND (
token = 's3SmSnuHWiUKaRaPKTKqnAJZYbbVMn2+2HvS1xDJ2/M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)