UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7DtVwhhe0FKSVn3z0/by7P3d7PHdxSWi5/PF6lXSRDY='
WHERE
key_id = 'f1f05e7ef97b13fe7ecf06eff9a4ecec53fa2724c6f1ba59ed3d450931da10d9'
AND (
token = '7DtVwhhe0FKSVn3z0/by7P3d7PHdxSWi5/PF6lXSRDY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)