UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'IsBlmoH4sP7iphzGDYGOxgNO8X1PAo9thqpu/eTnrgQ='
WHERE
key_id = 'd654b1991a0a138070fea9d78861ab2b474ca92ecba2d597af20c62343598f95'
AND (
token = 'IsBlmoH4sP7iphzGDYGOxgNO8X1PAo9thqpu/eTnrgQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)