UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3ahpXwkgbZ4PNN7W6xFmMK2RoAtJ0Ez3UciLzsYd0y0='
WHERE
key_id = '32fa4138160270aef6d94cdc67eb9f97206e640aabd1c00c1a475bcd36273ba8'
AND (
token = '3ahpXwkgbZ4PNN7W6xFmMK2RoAtJ0Ez3UciLzsYd0y0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)