UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JRAcXac2+kjk3vHZg+rZtNCW+KHDsynKySU/imyHLAc='
WHERE
key_id = '6cfc21e5c18164837aacd86a39616f5d319ca00f72bdc92b44c025b2cedc36bc'
AND (
token = 'JRAcXac2+kjk3vHZg+rZtNCW+KHDsynKySU/imyHLAc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)