UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GYcj33TtaQMGSldQCsONsfFQ1hJzGvLpRwMs2/0xyS4='
WHERE
key_id = '72efda65bf68e239683149099b421620670f95315815c5b4671694d7254c891c'
AND (
token = 'GYcj33TtaQMGSldQCsONsfFQ1hJzGvLpRwMs2/0xyS4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)