UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4AUZuxd9HQxtVfja+I2j5ManVhp4MA1LhStRxOrjgL0='
WHERE
key_id = '289d1b6648a240c46dbea31e52e14a0d56c42446b07f330303ff93e98c04a605'
AND (
token = '4AUZuxd9HQxtVfja+I2j5ManVhp4MA1LhStRxOrjgL0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)