UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'X+XPaOvjzd+/UYkOQUfbKrc0ZLdcakIU2C+giz+Todo='
WHERE
key_id = '73e92155bd89e84ca7ff99277bd96d1ef877d678b5e6b84c2ccb2c467ec01d95'
AND (
token = 'X+XPaOvjzd+/UYkOQUfbKrc0ZLdcakIU2C+giz+Todo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)