UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pYqbBTcVya9oT/h1abGnhdpqjguaDZSBaViTEwIM/Qc='
WHERE
key_id = 'f3d9cb1554275e39a6f0cc40d4ca18d2856396421cc00537ba56b7046079f5a8'
AND (
token = 'pYqbBTcVya9oT/h1abGnhdpqjguaDZSBaViTEwIM/Qc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)