UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5PnEgBRuoYVHhnuOfdotu54KGRvG3Kl1NQBlVoXraXY='
WHERE
key_id = 'd1a97af9b680f4075b3cf4b81decf4ff30eca7ec34cb38e8237ca6e861f2a9d3'
AND (
token = '5PnEgBRuoYVHhnuOfdotu54KGRvG3Kl1NQBlVoXraXY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)