UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bxrWxJkD0afAHwN0V2I2BlhcaRMjY2QOPuAKq87K3aE='
WHERE
key_id = 'facc88ef86fc89cc64726ce6a2bedef12448a521d90a788116a271c6e7615d2a'
AND (
token = 'bxrWxJkD0afAHwN0V2I2BlhcaRMjY2QOPuAKq87K3aE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)