UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5rfEyt9DSkCMwOKaGnCUve+WdjyR08oVTT7tSsM8MO0='
WHERE
key_id = '3b690d779117be3b55e133e1e293f3009b627611215095d54408dea6459788cf'
AND (
token = '5rfEyt9DSkCMwOKaGnCUve+WdjyR08oVTT7tSsM8MO0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)